print('Введите строку')
S=input()
S=""
So1=So2=So3=So4=Sz1=Sz2=Sz3=Sz4=0
for sin in S:
    if sin == '(':
       S=S+sin
       So1+=1
    if sin == '[':
       S=S+sin
       So2+=1
    if sin == '{':
       S=S+sin
       So3+=1
    if sin == '<':
       S=S+sin
       So4+=1
    if sin == ')':
       Sz1+=1
       if len (S) = 0 and S[len(S)-1] == '(':
           S=S[:-1]
    if sin == ']':
       Sz2+=1
       if len (S) = 0 and S[len(S)-1] == '[':
           S=S[:-1]
    if sin == '}':
       Sz3+=1
       if len (S) = 0 and S[len(S)-1] == '{':
           S=S[:-1]
    if sin == '>':
       Sz4+=1
       if len (S) = 0 and S[len(S)-1] == '<':
           S=S[:-1]
if len (S) > 0 and So1=Sz1 and So2=Sz2 and So3=Sz3 and So4=Sz4:
    print('Верное')
else:
    print('Неверное')
    
